<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GstAtomicQueue: GStreamer 1.0 Core Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="GStreamer 1.0 Core Reference Manual">
<link rel="up" href="libgstreamer.html" title="GStreamer Core Library">
<link rel="prev" href="GstAllocator.html" title="GstAllocator">
<link rel="next" href="GstBin.html" title="GstBin">
<meta name="generator" content="GTK-Doc V1.28 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#gstreamer-GstAtomicQueue.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="libgstreamer.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="GstAllocator.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="GstBin.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="gstreamer-GstAtomicQueue"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gstreamer-GstAtomicQueue.top_of_page"></a>GstAtomicQueue</span></h2>
<p>GstAtomicQueue — An atomic queue implementation</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="gstreamer-GstAtomicQueue.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a class="link" href="gstreamer-GstAtomicQueue.html#GstAtomicQueue" title="GstAtomicQueue"><span class="returnvalue">GstAtomicQueue</span></a> *
</td>
<td class="function_name">
<a class="link" href="gstreamer-GstAtomicQueue.html#gst-atomic-queue-new" title="gst_atomic_queue_new ()">gst_atomic_queue_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gstreamer-GstAtomicQueue.html#gst-atomic-queue-ref" title="gst_atomic_queue_ref ()">gst_atomic_queue_ref</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gstreamer-GstAtomicQueue.html#gst-atomic-queue-unref" title="gst_atomic_queue_unref ()">gst_atomic_queue_unref</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="gstreamer-GstAtomicQueue.html#gst-atomic-queue-push" title="gst_atomic_queue_push ()">gst_atomic_queue_push</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>
</td>
<td class="function_name">
<a class="link" href="gstreamer-GstAtomicQueue.html#gst-atomic-queue-peek" title="gst_atomic_queue_peek ()">gst_atomic_queue_peek</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>
</td>
<td class="function_name">
<a class="link" href="gstreamer-GstAtomicQueue.html#gst-atomic-queue-pop" title="gst_atomic_queue_pop ()">gst_atomic_queue_pop</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
</td>
<td class="function_name">
<a class="link" href="gstreamer-GstAtomicQueue.html#gst-atomic-queue-length" title="gst_atomic_queue_length ()">gst_atomic_queue_length</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gstreamer-GstAtomicQueue.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody><tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="gstreamer-GstAtomicQueue.html#GstAtomicQueue" title="GstAtomicQueue">GstAtomicQueue</a></td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="gstreamer-GstAtomicQueue.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gst/gst.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="gstreamer-GstAtomicQueue.description"></a><h2>Description</h2>
<p>The <a class="link" href="gstreamer-GstAtomicQueue.html#GstAtomicQueue" title="GstAtomicQueue"><span class="type">GstAtomicQueue</span></a> object implements a queue that can be used from multiple
threads without performing any blocking operations.</p>
</div>
<div class="refsect1">
<a name="gstreamer-GstAtomicQueue.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gst-atomic-queue-new"></a><h3>gst_atomic_queue_new ()</h3>
<pre class="programlisting"><a class="link" href="gstreamer-GstAtomicQueue.html#GstAtomicQueue" title="GstAtomicQueue"><span class="returnvalue">GstAtomicQueue</span></a> *
gst_atomic_queue_new (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> initial_size</code></em>);</pre>
<p>Create a new atomic queue instance. <em class="parameter"><code>initial_size</code></em>
 will be rounded up to the
nearest power of 2 and used as the initial size of the queue.</p>
<div class="refsect3">
<a name="gst-atomic-queue-new.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>initial_size</p></td>
<td class="parameter_description"><p>initial queue size</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-atomic-queue-new.returns"></a><h4>Returns</h4>
<p> a new <a class="link" href="gstreamer-GstAtomicQueue.html#GstAtomicQueue" title="GstAtomicQueue"><span class="type">GstAtomicQueue</span></a></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-atomic-queue-ref"></a><h3>gst_atomic_queue_ref ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gst_atomic_queue_ref (<em class="parameter"><code><a class="link" href="gstreamer-GstAtomicQueue.html#GstAtomicQueue" title="GstAtomicQueue"><span class="type">GstAtomicQueue</span></a> *queue</code></em>);</pre>
<p>Increase the refcount of <em class="parameter"><code>queue</code></em>
.</p>
<div class="refsect3">
<a name="gst-atomic-queue-ref.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>queue</p></td>
<td class="parameter_description"><p>a <a class="link" href="gstreamer-GstAtomicQueue.html#GstAtomicQueue" title="GstAtomicQueue"><span class="type">GstAtomicQueue</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-atomic-queue-unref"></a><h3>gst_atomic_queue_unref ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gst_atomic_queue_unref (<em class="parameter"><code><a class="link" href="gstreamer-GstAtomicQueue.html#GstAtomicQueue" title="GstAtomicQueue"><span class="type">GstAtomicQueue</span></a> *queue</code></em>);</pre>
<p>Unref <em class="parameter"><code>queue</code></em>
 and free the memory when the refcount reaches 0.</p>
<div class="refsect3">
<a name="gst-atomic-queue-unref.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>queue</p></td>
<td class="parameter_description"><p>a <a class="link" href="gstreamer-GstAtomicQueue.html#GstAtomicQueue" title="GstAtomicQueue"><span class="type">GstAtomicQueue</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-atomic-queue-push"></a><h3>gst_atomic_queue_push ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gst_atomic_queue_push (<em class="parameter"><code><a class="link" href="gstreamer-GstAtomicQueue.html#GstAtomicQueue" title="GstAtomicQueue"><span class="type">GstAtomicQueue</span></a> *queue</code></em>,
                       <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre>
<p>Append <em class="parameter"><code>data</code></em>
 to the tail of the queue.</p>
<div class="refsect3">
<a name="gst-atomic-queue-push.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>queue</p></td>
<td class="parameter_description"><p>a <a class="link" href="gstreamer-GstAtomicQueue.html#GstAtomicQueue" title="GstAtomicQueue"><span class="type">GstAtomicQueue</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>data</p></td>
<td class="parameter_description"><p>the data</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-atomic-queue-peek"></a><h3>gst_atomic_queue_peek ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>
gst_atomic_queue_peek (<em class="parameter"><code><a class="link" href="gstreamer-GstAtomicQueue.html#GstAtomicQueue" title="GstAtomicQueue"><span class="type">GstAtomicQueue</span></a> *queue</code></em>);</pre>
<p>Peek the head element of the queue without removing it from the queue.</p>
<div class="refsect3">
<a name="gst-atomic-queue-peek.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>queue</p></td>
<td class="parameter_description"><p>a <a class="link" href="gstreamer-GstAtomicQueue.html#GstAtomicQueue" title="GstAtomicQueue"><span class="type">GstAtomicQueue</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-atomic-queue-peek.returns"></a><h4>Returns</h4>
<p>the head element of <em class="parameter"><code>queue</code></em>
or
<a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> when the queue is empty. </p>
<p><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-atomic-queue-pop"></a><h3>gst_atomic_queue_pop ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>
gst_atomic_queue_pop (<em class="parameter"><code><a class="link" href="gstreamer-GstAtomicQueue.html#GstAtomicQueue" title="GstAtomicQueue"><span class="type">GstAtomicQueue</span></a> *queue</code></em>);</pre>
<p>Get the head element of the queue.</p>
<div class="refsect3">
<a name="gst-atomic-queue-pop.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>queue</p></td>
<td class="parameter_description"><p>a <a class="link" href="gstreamer-GstAtomicQueue.html#GstAtomicQueue" title="GstAtomicQueue"><span class="type">GstAtomicQueue</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-atomic-queue-pop.returns"></a><h4>Returns</h4>
<p>the head element of <em class="parameter"><code>queue</code></em>
or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> when
the queue is empty. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gst-atomic-queue-length"></a><h3>gst_atomic_queue_length ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>
gst_atomic_queue_length (<em class="parameter"><code><a class="link" href="gstreamer-GstAtomicQueue.html#GstAtomicQueue" title="GstAtomicQueue"><span class="type">GstAtomicQueue</span></a> *queue</code></em>);</pre>
<p>Get the amount of items in the queue.</p>
<div class="refsect3">
<a name="gst-atomic-queue-length.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>queue</p></td>
<td class="parameter_description"><p>a <a class="link" href="gstreamer-GstAtomicQueue.html#GstAtomicQueue" title="GstAtomicQueue"><span class="type">GstAtomicQueue</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gst-atomic-queue-length.returns"></a><h4>Returns</h4>
<p> the number of elements in the queue.</p>
</div>
</div>
</div>
<div class="refsect1">
<a name="gstreamer-GstAtomicQueue.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GstAtomicQueue"></a><h3>GstAtomicQueue</h3>
<pre class="programlisting">typedef struct _GstAtomicQueue GstAtomicQueue;</pre>
<p>Opaque atomic data queue.</p>
<p>Use the accessor functions to get the stored values.</p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.28</div>
</body>
</html>